﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Text;

namespace Quickuse.Logging.FileLogger
{
    /// <summary>
    /// IFileLoggerSettings
    /// </summary>
    internal interface IFileLoggerSettings
    {
        /// <summary>
        /// 应用标识
        /// </summary>
        string AppId { get; }

        /// <summary>
        /// ClusterSeq
        /// </summary>
        string ClusterSeq { get; }

        /// <summary>
        /// IncludeScopes (默认 true)
        /// </summary>
        bool IncludeScopes { get; }

        /// <summary>
        /// 文件名路径 (默认 logs/log.log)
        /// </summary>
        string FileName { get; }

        /// <summary>
        /// LogFloder (D:\\logs\\)
        /// </summary>
        string LogFloder { get; }

        /// <summary>
        /// LogFileName (log.log)
        /// </summary>
        string LogFileName { get; }

        /// <summary>
        /// FileMaxBackup （默认 30）
        /// </summary>
        int FileMaxBackup { get; }

        /// <summary>
        /// FileSize (单位 MB)
        /// </summary>
        int FileSize { get; }

        /// <summary>
        /// File Classify (默认 false)
        /// </summary>
        bool FileClassify { get; }

        /// <summary>
        /// IsAsyn (默认 true)
        /// </summary>
        bool IsAsyn { get; }

        /// <summary>
        /// 最大排队长度 （默认 10240）
        /// </summary>
        int MaxQueuedLength { get; }

        /// <summary>
        /// 获得 实例销毁时日志任务等待时间 默认为 2 秒
        /// </summary>
        TimeSpan TaskWaitTime { get; }

        /// <summary>
        /// Levels
        /// </summary>
        List<LogLevel> Levels { get; }

        /// <summary>
        /// ChangeToken
        /// </summary>
        IChangeToken ChangeToken { get; }

        /// <summary>
        /// TryGetSwitch
        /// </summary>
        /// <param name="name">name</param>
        /// <param name="level">level</param>
        /// <returns></returns>
        bool TryGetSwitch(string name, out LogLevel level);

        /// <summary>
        /// Reload
        /// </summary>
        /// <returns></returns>
        IFileLoggerSettings Reload();
    }
}
